﻿<!--Author: Troy Thompson | January 29, 2013-->

@model thailandProject.Models.PROPERTY

@{
    ViewBag.Title = "Edit Property";
}

<div id="Wrapper2">
<div id="content_header">
        <div id="headerimage">
        </div>
        <div id="theheader">@ViewBag.Header</div>
    </div>
    <!-- Left Column begins here -->
    <aside id="sidebar-wrapper">
        <nav class="sidebar">
            <!-- CONTENT GOES HERE -->

    @using (Html.BeginForm("EditProperty", "Property"))
    {
        <div class="display-label">Property Name</div>
        <div class="display-field">
            @Html.HiddenFor(model => model.propID)
            @Html.ValidationMessageFor(model => model.propID)
        </div>
        <div class="display-field">
            
            @Html.EditorFor(model => model.propName)
            @Html.ValidationMessageFor(model => model.propName)
        </div>
        
        <div class="display-label">Is Active</div>
        <input type="checkbox" id="isActiveCheckbox" name="isActive" onchange="this.form.submit()" value="true" 
            @if((bool)Session["isActive"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propIsActive)
              @Html.ValidationMessageFor(model => model.propIsActive)
            }/>
        
        <div class="display-label">Details</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propDetails)
            @Html.ValidationMessageFor(model => model.propDetails)
        </div>
        
        <div class="display-label">Location</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propLocation)
            @Html.ValidationMessageFor(model => model.propLocation)
        </div>
        
        <div class="display-label">Square Feet</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propSqFt)
            @Html.ValidationMessageFor(model => model.propSqFt)
        </div>
         
        <div class="display-label">Has Gym</div>
        <input type="checkbox" id="hasGymCheckbox" name="hasGym" onchange="this.form.submit()" value="true" 
            @if((bool)Session["hasGym"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propGym)
              @Html.ValidationMessageFor(model => model.propGym)
            }/>
        
        <div class="display-label">Has Parking</div>
        <input type="checkbox" id="hasParkingCheckbox" name="hasParking" onchange="this.form.submit()" value="true" 
            @if((bool)Session["hasParking"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propParking)
              @Html.ValidationMessageFor(model => model.propParking)
            }/>
        
        <div class="display-label">Has Pool</div>
        <input type="checkbox" id="hasPoolCheckbox" name="hasPool" onchange="this.form.submit()" value="true" 
            @if((bool)Session["hasPool"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propPool)
              @Html.ValidationMessageFor(model => model.propPool)
            }/>
        
        <div class="display-label">Has Wi-Fi</div>
        <input type="checkbox" id="hasWiFiCheckbox" name="hasWiFi" onchange="this.form.submit()" value="true" 
            @if((bool)Session["hasWiFi"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propWiFi)
              @Html.ValidationMessageFor(model => model.propWiFi)
            }/>
        
        <div class="display-label">Has Sauna</div>
        <input type="checkbox" id="hasSaunaCheckbox" name="hasSauna" onchange="this.form.submit()" value="true" 
            @if((bool)Session["hasSauna"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propSauna)
              @Html.ValidationMessageFor(model => model.propSauna)
            }/>
        
        <div class="display-label">Type of Property</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propType)
            @Html.ValidationMessageFor(model => model.propType)
        </div>
        
        <div class="display-label"># Bedrooms</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propBedrooms)
            @Html.ValidationMessageFor(model => model.propBedrooms)
        </div>
        
        <div class="display-label"># Baths</div>
        <div class="display-field">
            @Html.EditorFor(model => model.propBaths)
            @Html.ValidationMessageFor(model => model.propBaths)
        </div>
        
        <div class="display-label">Pets Allowed</div>
        <input type="checkbox" id="petsAllowedCheckbox" name="petsAllowed" onchange="this.form.submit()" value="true" 
            @if((bool)Session["petsAllowed"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propPetsAllowed)
              @Html.ValidationMessageFor(model => model.propPetsAllowed)
            }/>
        
        <div class="display-label">Smoking Allowed</div>
        <input type="checkbox" id="smokingAllowedCheckbox" name="smokingAllowed" onchange="this.form.submit()" value="true" 
            @if((bool)Session["smokingAllowed"])
            { @:checked="checked"
              @Html.EditorFor(model => model.propSmoking)
              @Html.ValidationMessageFor(model => model.propSmoking)
            }/>
        
        <div class = "formButtons">
        <input type="submit" id="submitEdit" value="Save" />
        </div>
    }
           
<p>
    @Html.ActionLink("Back", "ViewAllProperties")
</p>

            </nav>
    </aside>
    <!-- Right column begins here -->
    <article id="contents">
        Content
    </article>
    <!-- Right column ends here -->
</div>
<!-- Div wrapper2 ends here -->